package com.gm.commonlib.base.basePresenter;

import com.gm.commonlib.base.baseView.IBaseView;

import java.lang.ref.WeakReference;

public class BasePresenter<T extends IBaseView> {
    public WeakReference<T> mBaseView;
     //todo 绑定activity
  public   void onAttach(T view){
        mBaseView=new WeakReference<>(view);
    }
    //todo activity销毁及时清空view 防止内存泄露
    public void onDetach(){
        if (mBaseView!=null){
            mBaseView.clear();
            mBaseView=null;
        }
    }
}
